﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Linq.Expressions;

namespace MobiMenu.Restaurant.Web.Utility
{
    /// <summary>
    ///Utility 的摘要说明
    /// </summary>
    public class CommonHelper
    {
        public static int? CovertToInt32Null(int inValue)
        { 
            return inValue;
        }

        public static IQueryable<TEntity> QueryOrder<TEntity, TCompare>(IQueryable<TEntity> query,
            Expression<Func<TEntity, TCompare>> expr, bool isDesc)
        {
            return isDesc ? query.OrderByDescending(expr) : query.OrderBy(expr);
        }

    }
}